#ifndef RENDER_MISCS_H
#define RENDER_MISCS_H

#include "stdafx.h"
#include "Scene.h"
#include "StaticMesh.h"
#include "RenderInterface.h"

class DecoRenderMisc
{
private:
	DecoStaticMesh m_rotation;
	DecoStaticMesh m_axis_x;
	DecoStaticMesh m_axis_y;
	DecoStaticMesh m_axis_z;
	DecoStaticMesh m_box;
	DecoStaticMesh m_point;
	DecoRenderInterface* RI;
	BOOL m_bHideBox;
	BOOL m_bHideAxis;
	BOOL m_bHideRotation;


	DecoRenderMisc() {
		RI = NULL;
		m_bHideBox = TRUE;
		m_bHideAxis = TRUE;
		m_bHideRotation = TRUE;
	}
	~DecoRenderMisc() {};
	static DecoRenderMisc* msRenderMisc;

public:
	static DecoRenderMisc* GetSingleton();
	static void DestroySingleton();
	void DrawAxis (DecoSceneNode* SN, Coords coord, BOOL bDrawX = TRUE, BOOL bDrawY = TRUE, BOOL bDrawZ = TRUE);
	void DrawBox (DecoSceneNode* SN, const Box& box, const DecoColor& color = DecoColor(0xffffffff));
	void DrawRotation(DecoSceneNode* SN, Coords coord, BOOL bDrawX = TRUE, BOOL bDrawY = TRUE, BOOL bDrawZ = TRUE);
	void DrawPointList(DecoSceneNode* SN, const vector3* point, UINT numPoints, const DecoColor& color, FLOAT width = 1);
	void DrawPointList(DecoSceneNode* SN, const vector3* point, const DecoColor* color, UINT numPoints, FLOAT width = 1);
	void DrawLineStrip(const vector3* point, const DecoColor* color, UINT numPoints, FLOAT width);
	void DrawLine(const vector3& start, const vector3& end, DecoColor color = DecoColor(0, 0, 0), FLOAT width = 1);
	void SetLineWidth (FLOAT n);
	void ShowAxis(BOOL bShow = FALSE)
	{
		m_bHideAxis = !bShow;
	}
	void ShowBox(BOOL bShow = FALSE)
	{
		m_bHideBox = !bShow;
	}
	void ShowRotation(BOOL bShow = FALSE)
	{
		m_bHideRotation = !bShow;
	}
	void Serialize(DecoArchive& Ar);
	void Deserialize(DecoArchive& Ar);
	static void Initialize(DecoRenderInterface* _RI);
};
#endif